
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>优惠卡券 | 会员卡</title>
	<include file="Public/head"/>
    <!-- FooTable -->
    <link href="__CSS__/footable.core.css" rel="stylesheet">
	<link href="__CSS__/custom.css" rel="stylesheet">
	<style>
		.ibox{
		 	border: 1px solid #e7eaec;
		}
		.part_item {
  			background: none repeat scroll 0 0 #fff;
  			border: 1px solid #ccc;
  			border-radius: 5px;
  			padding-bottom: 15px;
  			margin-bottom: 10px;
		}
		.form .part_item p {
  			display: inline-block;
  			font-size: 14px;
  			overflow: hidden;
  			padding: 10px 20px 0;
  			text-overflow: ellipsis;
  			white-space: nowrap;
		}
		.part_item_b {
  			border-top: 1px solid #ccc;
  			margin-top: 10px;
		}
		.form .part_item p.active {
  			color: #f87b00;
		}
		.part_item input {
  			font-size: 14px;
  			margin-bottom: 2px;
  			margin-right: 5px;
		}
		.pagination{
			margin:0px;
		}
		.mustInput {
  			color: red;
  			margin-right: 5px;
		}
		@media (min-width: 768px){
			.form .part_item p {
				width: 37%;
			}
		}
		@media (min-width: 992px){
			.form .part_item p {
				width: 24%;
			}
		}
	.form-control, .single-line{width: 50%;}
	
	</style>
</head>

<body>

    <div id="wrapper">
<include file="Public/leftmenu"/>

        <div id="page-wrapper" class="gray-bg">
    <include file="Public/top"/>
            <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>会员卡列表</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a>Member</a>
                        </li>
            
                        <li class="active">
                            <strong>会员卡</strong>
                        </li>
                    </ol>
                </div>
                <div class="col-lg-2">

                </div>
            </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
							<form action="?s=Member/lists" id="search" method="post">
                                <input style="width:20%;float:left;" name="mobile" onkeyup="this.value=this.value.replace(/[^\w\.\/]/ig,'')" value="{$mobile}" type="text" class="form-control input-sm m-b-xs" id="filter" placeholder="手机号/会员卡号" method="post">
								<a onclick="return serch();"href="javascript:void(0)" style="float:left;margin-left:20px;" class="btn btn-primary js-create-qrcode">查找</a>
															<!-- <a href="?s=Member/daochu&mobile={$mobile}" style="float:left;margin-left:20px;" class="btn btn-primary js-create-qrcode">导出统计数据</a> -->
			<a href="?s=Member/bill" style="float:right;margin-left:20px;" class="btn btn-primary js-create-qrcode">店铺账单流水</a>

							</form>
							<form action="?s=Member/DelAll" class="employersDelAll" method="post">
                            <table class="footable table table-stripped toggle-arrow-tiny" >
                                <thead>
                                <tr>
                                    <!-- <th data-sort-ignore="true" class="check-mail"><input type="checkbox" class="i-checks" id="check_box"></th> -->
                                <!--    <th>会员卡号</th>-->
                                    <th data-hide="phone">持卡人</th>
                                 <th data-hide="phone">会员卡号</th>
									<th data-hide="phone">领卡时间</th>
									   <th data-hide="phone">手机号</th>
									<th data-hide="phone">积分</th>
									<th data-hide="phone">余额</th>
								<th data-hide="phone">状态</th>
                                    <th data-sort-ignore="true">操作</th>
                                </tr>
                                </thead>
                                <tbody>
							<notempty name="list">
								
			<volist name="list" id="data">
                                <tr>
                                    <!-- <td class="check-mail"><input type="checkbox" class="i-checks" value="{$data.id}" name="id[]"></td> -->
                                  <!--  <td>{$data.cartid}</td>-->
									<td>{$data.name}</td>
									<td>{$data.cardnum}</td>
									<td>{$data.add_time|date='Y-m-d',###}</td>
                                    <td>{$data.mobile}</td>
									<td>{$data.point}</td>
									<td>{$data.money}</td>
                                   <!-- <td>
										<div class="switch">
                                			<div class="onoffswitch">
                                			    <input type="checkbox" <eq name="data.status" value="0"> checked </eq> class="status-checkbox onoffswitch-checkbox" data-id="{$data.id}" id="example{$data.id}" value=''>
                                			    <label class="onoffswitch-label" for="example{$data.id}">
                                			        <span class="onoffswitch-inner"></span>
                                			        <span class="onoffswitch-switch"></span>
                                			    </label>
                                			</div>
                            			</div>
									</td> btn btn-sm btn-info  -->
									<td id="td_{$data.id}"><eq name="data['flag']" value="0"><a href="javascript:void(0);" onclick="check('this','{$data.id}')" style="margin-right:10px;"  class="btn btn-sm btn-primary">启用认证</a>  </eq><eq name="data['flag']" value="1"><font color="red">已认证</font></eq>
									
									</td>
                                    <td class="center">
										<div class="btn-group">
		<a href="?s=Member/paycheck/id/{$data.id}" style="margin-right:10px;"  class="btn btn-sm btn-primary">充值</a>  
  		<a href="?s=Member/consume/id/{$data.id}" style="margin-right:20px;" class="btn btn-sm btn-primary">消费</a>  
		<a href="?s=Member/edit/id/{$data.id}" class="btn btn-sm btn-white " ><i class="fa fa-paste"></i> 编辑会员</a> 

        <a href="javascript:void(0)" class="btn btn-sm btn-danger employersDel" data-id="{$data.id}"><i class="fa fa-times"></i> 删除</a>
		<a href="?s=Member/bill/id/{$data.id}" class="btn btn-sm btn-white "><i class="fa fa-paste"></i> 账单</a>   
                                        </div>
									</td>
                                </tr>
								   </volist>
							   <else/>
								<tr><td colspan="4" style="text-align: center; font-size: 16px;">暂无会员记录</td></tr>
						 </notempty>
                                </tbody>
                            </table>
							</form>
							<div class="js-list-footer-region ui-box">
									<div class="widget-list-footer">{$page}</div>
								</div>
									<div class="tooltip-demo">
									<!--<button class="btn btn-white btn-sm" data-toggle="modal" data-target="#myModal5" data-toggle="tooltip" data-placement="left" title="" data-original-title="添加员工"><i class="fa fa-plus"></i> 添加</button>-->
				<!-- 				<button class="btn btn-white btn-sm info_del_all" data-toggle="tooltip" data-placement="top" title="" data-original-title="删除会员"><i class="fa fa-trash-o"></i> </button> -->
							<!--	<a onclick="return serch();"href="javascript:void(0)" style="margin-left:10px;" class="btn btn-primary js-create-qrcode">添加会员卡</a>-->
								<ul class="pagination pull-right"></ul>
							</div>
                        </div>
                        		 
                    </div>
                </div>
            </div>
        </div>
<include file="Public/footer"/>

     </div>
    </div>
  <!--    <script src="__JS__/footable.all.min.js"></script>
	
	 
    <script src="__JS__/icheck.min.js"></script>

 <script src="__JS__/jquery.validate.min.js"></script>-->
<script>
function serch()
{
	var bb = $("#filter").val();
	if(!bb)
	{
       swal("错误", "请输入输入手机号 :)", "error");
	   		
	}
	$('#search').submit();
}

function check(dom,id)
{					
	$.post('?s=Member/openAuth',{id:id}, function(data){
		$("#td_"+id).html('');
		$("#td_"+id).html(data);
					 
	});
}
        $(document).ready(function() {
		

			employers.init();
        });
		!function(a,b){
			var employers = employers || {};
			employers.init = function(){
				var c = employers;
				//b('.footable').footable();
				//b('.i-checks').iCheck({
                	//checkboxClass: 'icheckbox_square-green',
                	//radioClass: 'iradio_square-green',
            //	});
				b('#check_box').on('ifChanged', function(){
					c.selectall('id[]','check_box');
				});
				b('.info_del_all').click(function(){
					c.delAll();
				});
				b('.onoffswitch-inner').click(function(){
					alert('dd');
				});
								b('.onoffswitch-checkbox').click(function(){
					alert('11dd');
				});
											
				b('.employersDel').click(function(){
					c.del(b(this).attr('data-id'));
				});
			};
			employers.selectall = function(name,id){
				var checkItems = b('input[name="'+name+'"]');
				if ($("#"+id).is(':checked') == false) {
					checkItems.each(function(ke,el){
						$(el).iCheck('uncheck');
					});
				}else{
					checkItems.each(function(ke,el){
						$(el).iCheck('check');
					});
				}
			}
			employers.del = function(id){
				swal({
        			title: "是否删除选中?",
        			text: "删除数据后将无法恢复，确认要删除吗！",
        			type: "warning",
                    confirmButtonColor: "#DD6B55",
                    confirmButtonText: "删除",
                    cancelButtonText: "取消",
                    closeOnConfirm: false,
                    showCancelButton: true,
    			}, function (){
	                 if(id<1)
					{
                      						swal("错误", "你至少需要选中一项 :)", "error");
						return false;
					}
					location.href='?s=Member/DelAll&id='+id;
    			});
			}
			employers.delAll = function(){
				swal({
        			title: "是否删除选中?",
        			text: "删除数据后将无法恢复，确认要删除吗！",
        			type: "warning",
                    confirmButtonColor: "#DD6B55",
                    confirmButtonText: "删除",
                    cancelButtonText: "取消",
                    closeOnConfirm: false,
                    showCancelButton: true,
    			}, function (){
					var checkItems = b('input[name="id[]"]'),c = false;
			
					checkItems.each(function(ke,el){
						if($(el).is(':checked') == true){
							c = true;
						}
					});
					if(c == false){
						swal("错误", "你至少需要选中一项 :)", "error");
						return false;
					}
					$('.employersDelAll').submit();
    			});
			}

			a.employers = employers;
		}(window,jQuery);
			</script>

</body>
</html>